<template>
    <div>
        <table>
            <tr>
                <th>ID</th>
                <th>用户</th>
                <th>密码</th>
                <th>电话</th>
            </tr>
            <tr v-if= "a == 2">
                <th>{{i_id}}</th>
                <th>{{i_username}}</th>
                <th>{{i_password}}</th>
                <th>{{i_phone}}</th>
            </tr>
        </table>
    </div>
</template>

<script>
import axiso from "axios"
export default {
    name:"jwt_show",
    data(){
        return{
            i_id:"",
            i_username:"",
            i_password:"",
            i_phone:"",
            a:1
        }
    },

    methods:{
        show(){
            axiso({
                url:"/api/users/v1/usershow/",
                method:"get",
                headers:{
                        "Authorization":"JWT "+ sessionStorage.getItem("jwt_token")
                    }
            }).then(res=>{
                console.log(res)
                this.a=2
                this.i_id=res.data.id
                this.i_username =res.data.username
                this.i_password =res.data.password
                this.i_phone =res.data.phone

            })
        }
    },
    created(){
        this.show()
    }
}
</script>

<style>

</style>
